1. Field of the Invention
Character segmentation is one of the pre-processing steps of character recognition. Many papers and patents have been published for this technology, such as:
Y. Lu, “Machine printed Character Segmentation—An Overview”, Pattern Recognition, Vol. 28, no. 1, pp. 67-80, Jan. 1995;
S. W. Lee, D. J. Lee, H. S. Park, “A New Methodology for Gray-Scale Character Segmentation and Recognition”, IEEE transaction on pattern analysis and machine intelligence, Vol. 18, no. 10, pp. 1045-1050, Oct. 1996;
Kamitani “Character segmentation device and character segmentation system”, U.S. Pat. No. 6,327,385;
Hanson, “Apparatus for performing character segmentation using slant histograms”, U.S. Pat. No. 5,692,069; and
Tan, “Fast character segmentation of skewed text lines for optical character recognition”, U.S. Pat. No. 5,172,422, etc.
All of the aforementioned papers and patents are dealing with how to process touching characters, and many of these methods make use of binary character images, but the application of these methods in segmentation of low resolution images raises as many errors as they could solve. So far, not a single paper or patent has been proposed to deal with segmentation of low resolution grayscale characters.
Low resolution character recognition is a very difficult task. Using of grayscale feature is one possible solution to this problem. However, if the character is not segmented precisely from the background, the feature extracted from the image will not be very effective. So a precise segmentation of the low resolution character is a must to a successful grayscale feature extraction method.
For a low resolution character image, the size is usually less than 20*20 pixels and the real boundary of the character is usually located within one pixel. Consequently, a precise location of real character boundary is very important to the subsequent feature extraction module. It is obvious that there is a need for a method and an apparatus capable of precise segmentation of low resolution grayscale character images.
2. Description of the Related Art
The present invention is proposed in view of the above defects in the state of the art to provide an apparatus and a method for precise segmentation of grayscale characters.
According to one aspect of this invention, there is provided a precise grayscale character segmentation apparatus, which comprises an adjustment and segmentation unit, for adjusting and segmenting single-character images in a low resolution grayscale text line image undergone coarse segmentation which is inputted therein, so as to generate adjusted and segmented character images; a character image binarization unit, for generating a binary character image from the adjusted and segmented character image inputted; a noise removal unit, for removing noise information in the binary character image generated by the character image binarization unit; and a final character image segmentation unit, for generating a precisely segmented character image from the binary character image from which noise information has been removed.
The apparatus preferably further includes an amplification unit, which is interposed between the adjustment and segmentation unit and the character image binarization unit, for amplifying the adjusted and segmented character image generated by the adjustment and segmentation unit before the adjusted and segmented character image is inputted into the character image binarization unit.
The apparatus preferably further includes a character image enhancement unit, which is interposed between the adjustment and segmentation unit and the character image binarization unit, for enhancing the adjusted and segmented character image generated by the adjustment and segmentation unit before the adjusted and segmented character image is inputted into the character image binarization unit, to make clearer the strokes of the character within the character image.
The apparatus preferably further includes a character image enhancement unit, which is interposed between the amplification unit and the character image binarization unit, for enhancing the adjusted and segmented character image amplified by the amplification unit before the adjusted and segmented character image amplified is inputted into the character image binarization unit, to make clearer the strokes of the character within the character image.
Preferably, the adjustment and segmentation unit includes a text line direction detection unit, for detecting the direction of the text line which is in the text line image; a character image size calculation unit, for calculating the size of the character image; and a character image adjustment unit, for adjusting the character image in response to the detecting result of the text line direction detection unit and the calculating result of the character image size calculation unit, so that all strokes of the character are contained in the character image.
Preferably, the character image enhancement unit includes a background pixel value estimation unit, for estimating the background pixel value of an inputted character image; a background removal unit, for removing the background of the character image based on the estimating result estimated by the background pixel value estimation unit; and a pixel value enhancement unit, for enhancing pixel value of the character image from which the background has been removed.
Preferably, the background pixel value estimation unit estimates the background pixel value using a histogram based method.
Preferably, the pixel value enhancement unit enhances the pixel value of the character image whose background has been removed using an S shape function.
Preferably, the noise removal unit includes a connected component analysis unit, for analyzing connected components of the binary character image to find out all pixel points of each connected component and calculate the total number of the connected components within the binary character image; a noise connected component determination unit, for determining whether a connected component is a noise connected component; and a noise connected component removal unit, for removing the connected component within the binary character image which is determined as a noise connected component by the noise connected component determination unit.
Preferably, the noise connected component determination unit determines whether a connected component is a noise connected component by the following two condition: 1) size of the connected component<size of the binary character image/scale number; and 2) distance between the boundary of the connected component and the boundary of the binary character image<threshold; a connected component is determined as a noise connected component if it satisfies both of the conditions.
Preferably, the scale number is 3 or 4.
According to another aspect of this invention, there is provided a method for precisely segmenting single grayscale characters in a text line image undergone coarse segmentation, comprising: an adjustment and segmentation step, for adjusting and segmenting single-character images in an inputted low resolution grayscale text line image undergone coarse segmentation, so as to generate adjusted and segmented character images; a character image binarization step, for binarizing the character image processed by the adjustment and segmentation step; a noise removal step, for removing noise information in the binary character image generated at the character image binarization step; and a final character image segmentation step, for generating a precisely segmented character image from the binary character image from which noise information has been removed.
The method preferably further includes an amplification step, for amplifying the adjusted and segmented character image generated at the adjustment and segmentation step.
The method preferably further includes a character image enhancement step, for enhancing the adjusted and segmented character image amplified at the amplification step, to make clearer the strokes of the character within the character image.
The adjustment and segmentation step includes a text line direction detection step, for detecting the direction of the text line; a character image size calculation step, for calculating the size of the character image; and a character image adjustment step, for adjusting the character image in response to the detecting result of the text line direction detection step and the calculating result of the character image size calculation step, so that all strokes of the character are contained within the character image.
The character image enhancement step includes a background pixel value estimation step, for estimating the background pixel value of a character image; a background removal step, for removing the background of the character image based on the estimating result estimated by the background pixel value estimation step; and a pixel value enhancement step, for enhancing pixel value of the character image from which the background has been removed.
The background pixel value is estimated by using a histogram based method at the background pixel value estimation step.
The pixel value of the character image from which the background has been removed is enhanced using an S shape function at the pixel value enhancement step.
The noise removal step includes a connected component analysis step, for analyzing connected components of the binary character image to find out all pixel points of each connected component and calculate the total number of the connected components within the binary character image; a noise connected component determination step, for determining whether a connected component is a noise connected component; and a removal step, for removing the connected component within the binary character image which is determined as a noise connected component at the noise connected component determination step.
A connected component is determined whether to be a noise connected component or not at the noise connected component determination step by the following two conditions: 1) size of the connected component<size of the binary character image/scale number; and 2) distance between the boundary of the connected component and the boundary of the binary character image<threshold; a connected component is determined as a noise connected component if it satisfies both of the conditions.
This invention can precisely obtain the boundary of a character in a low resolution character image, and can thus perform effective segmentation of character images, thereby guaranteeing effective subsequent procedures (such as character feature extraction) in character recognition.